﻿//----------------------------------------------------------------
// Desc: 
// Edit: ShowLong, http://blog.csdn.net/showlong
//
// Date Created: 2012-10-26
//
// Update Date : 
//
// Copyright (c) Fuel4D (http://www.fuel4d.com), All rights reserved.
//
//----------------------------------------------------------------
#pragma once


FINLINE bool IFPackage::Save(const NCHAR* file)
{
#ifdef UNICODE
    return SaveW(file);
#else
    return SaveA(file);
#endif
}

FINLINE bool IFPackage::Load (const NCHAR* file)
{
#ifdef UNICODE
    return LoadW(file);
#else
    return LoadA(file);
#endif
}

FINLINE bool IFPackage::AddFile (const NCHAR* file)
{
#ifdef UNICODE
    return AddFileW(file);
#else
    return AddFileA(file);
#endif
}

FINLINE size_t IFPackage::AddDir (const NCHAR* dir, bool sub_dir, FVString * vdir, FVString * vext, DWORD vec_mark)
{
#ifdef UNICODE
    return AddDirW(dir, sub_dir, vdir, vext, vec_mark);
#else
    return AddDirA(dir, sub_dir, vdir, vext, vec_mark);
#endif
}

FINLINE bool IFPackage::DelFile (const NCHAR* file)
{
#ifdef UNICODE
    return DelFileW(file);
#else
    return DelFileA(file);
#endif
}

FINLINE bool IFPackage::GetFile (const NCHAR* file, FV_BYTE& out)
{
#ifdef UNICODE
    return GetFileW(file, out);
#else
    return GetFileA(file, out);
#endif
}

FINLINE bool IFPackage::Extract (const NCHAR* file, const NCHAR* dst_file)
{
#ifdef UNICODE
    return ExtractW(file, dst_file);
#else
    return ExtractA(file, dst_file);
#endif
}

FINLINE bool IFPackage::Diff (IFPackage* right, FV_FPK_FILE& vadd, FV_FPK_FILE& vdel, FV_FPK_FILE& vmdf, const NCHAR* diff_file)
{
#ifdef UNICODE
    return DiffW(right, vadd, vdel, vmdf, diff_file);
#else
    return DiffA(right, vadd, vdel, vmdf, diff_file);
#endif
}